let btn1 = document.querySelector('button');
let btn2 = document.querySelector('p.reset');
console.log(btn1,btn2)

btn1.addEventListener('click', ()=>{
  goTo(1)
}, false)
btn2.addEventListener('click', ()=>{
  goTo(2)
}, false)

function goTo(index) {
  if(index===2){
    window.history.go(-1)
  }
  try {
    // 如果是 iOS 设备，则使用如下 hack 的写法实现页面标题的更新
    if (navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
      window.webkit.messageHandlers.finishRiskEvaluation.postMessage(index===1);
    } else { //安卓
      window.JinrLoan.finishRiskEvaluation(index===1);

    }
  } catch (e) {
    console.log(e);
  }
}